package com.learn.springlearn.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitDirectConfig {

    @Bean
    public Queue directQueue(){
        return new Queue("testQueue",true);
    }

    @Bean
    DirectExchange directExchange(){
        return new DirectExchange("testExchange",true,false);
    }

    @Bean
    Binding bindingBuilder(){
        return BindingBuilder.bind(directQueue()).to(directExchange()).with("smp");
    }
}
